<%@ attribute name="names" required="true"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<%
    StringBuffer result = new StringBuffer("<tr>");
    String[] cells = getJspContext().getAttribute("names").toString().split(",");
    if (cells.length > 0) {
        result.append("<th id='f'>").append(cells[0]).append("</th>");
        if (cells.length > 2) {
            for (int i = 1; i < cells.length - 1; i++) {
                result.append("<th>").append(cells[i]).append("</th>");
            }
        }
        if (cells.length > 1) {
            result.append("<th id='l'>").append(cells[cells.length-1]).append("</th>");
        }
    }
    result.append("</tr>");
    out.println(result.toString());
%>
